package crl.lottery.view
{
	import flash.display.MovieClip;
	import flash.events.MouseEvent;

	public class LButton
	{
		private var skin:MovieClip;
		public function LButton(mc:MovieClip)
		{
			mc.stop();
			mc.buttonMode=true;
			mc.addEventListener(MouseEvent.ROLL_OVER,overHandle);
			mc.addEventListener(MouseEvent.ROLL_OUT,overHandle);
			mc.addEventListener(MouseEvent.MOUSE_DOWN,downHandle);
			skin=mc;
		}
		
		protected function downHandle(event:MouseEvent):void
		{
			// TODO Auto-generated method stub
			skin.gotoAndStop(3);
		}
		
		protected function overHandle(event:MouseEvent):void
		{
			// TODO Auto-generated method stub
			var frame:int=event.type==MouseEvent.ROLL_OVER?2:1;
			
			skin.gotoAndStop(frame);
		}		
		
	}
}